﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using GTServices.Entities;
using System.Globalization;
using System.Windows;

namespace GTServices.WPF.Client.Converters
{
    public class BoolToVisabilityConverter : IValueConverter
    {
       

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {

            bool ret = false;
            
            ret = (bool)value;

            if (parameter != null && ((string)parameter).ToLower() == "not")
            {
                ret = !ret;
            }


            if (ret)
            {
                return Visibility.Visible;
            }else{
                return Visibility.Collapsed;
            }
            
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {

            return null;
        }
    }
}
